The use of time-of-flight (TOF) cameras has received a lot of attention recently for use in robot milking systems. A time-of-flight camera is a range imaging camera system that resolves distance based on the known speed of light, measuring the time-of-flight of a light signal between the camera and the subject for each point of the image.
However, it is not straight-forward to implement the time-of-flight camera for a robot milking system due to the harsh environment, in which the time-of-flight camera should be used. Typically, the time-of-flight camera is located on a robot arm of a robot provided for attaching teat cups of the milking system to the teats of an animal to be milked. Therefore, the time-of-flight camera may come into close contact with not only parts of the barn in which the milking system is installed, but also into close contact with the animals.
As a result, the time-of-flight camera has to withstand not only dirt, animal faeces, various fluids, and possibly chemicals, such as cleaning chemicals, but also kicks and other mechanical stresses and strains. To this end the time-of-flight camera has to be robust and sealed. However, in particular, a front window or lens of the time-of-flight camera may become dirty and/or damaged, such as scratched, during use. Typically, cleaning systems are provided for cleaning the front window or lens of the time-of-flight camera repeatedly such as several times a day. Nevertheless, such cleaning may sometimes be insufficient, and in case the window or lens of the time-of-flight camera is seriously damaged, the time-of-flight camera may not be capable of being used any longer.